{extend name="public/base" /}

{block name="title"}<title>{if condition="$data"}{$Think.lang.edit}{else /}{$Think.lang.create}{/if}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>场馆管理</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 场馆管理</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" onsubmit="return false" enctype="multipart/form-data">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab1" data-toggle="tab">{$Think.lang.base_param}</a></li>
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm"
                                                  style="padding:10px 2px;"><i class="fa fa-list"></i>
                            {$Think.lang.back}</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">场馆名称</label>
                                <div class="col-sm-7"><input class="form-control" name="designation" value=""
                                                             placeholder="场馆名称">

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">场馆地址</label>
                                <div class="col-sm-2">
                                    <div class="col-sm-2" id="city">
                                        <select class="prov"></select>
                                        <select class="city" name='area' disabled="disabled"></select>
                                        <select class="dist" disabled="disabled"></select>
                                    </div>

                                </div>

                                <div class="col-sm-5">
                                    <input class="form-control" name="address" value=""
                                           placeholder="场馆地址"></div>
                            </div>





                            <div class="form-group">
                                <label class="col-sm-2 control-label">场馆介绍</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">场馆面积</label>
                                <div class="col-sm-7">

                                    <input class="form-control" name="area" value=""
                                           placeholder="场馆面积">

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">场馆器械</label>
                                <div class="col-sm-7">

                                    <input class="form-control" name="qixie" value=""
                                           placeholder="场馆器械">

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">可选课程</label>
                                <div class="col-sm-7">

                                    <input class="form-control" name="course" value=""
                                           placeholder="可选课程">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">营业时间</label>
                                <div class="col-sm-7"><input class="form-control" name="business_hours" value=""
                                                             placeholder="营业时间"></div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Cost</label>
                                <div class="col-sm-7"><input class="form-control" name="cost" value=""
                                                             placeholder="Cost"></div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否有WIFI</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="wifi" style="width:100%;">
                                        <option value="1">有</option>
                                        <option value="0">无</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right sub" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; {$Think.lang.submit}">{$Think.lang.submit}</button>
                            </div>
                            <div class="btn-group pull-left">
                                <button type="reset" class="btn btn-warning">{$Think.lang.reset}</button>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        </form>

    </div>

    </div>

</section>
<script type="text/javascript">
    $(function(){
        $("#fileUploadContent").initUpload({
            "uploadUrl":"{:url('Place/add')}",//上传文件信息地址
            // "size":2048,//文件大小限制，单位kb,默认不限制
            "maxFileNumber":5,//文件个数限制，为整数
            // "filelSavePath":"uploads/image/",//文件上传地址，后台设置的根目录
            "beforeUpload":beforeUploadFun,//在上传前执行的函数
            // "onUpload":onUploadFun，//在上传后执行的函数
            //autoCommit:true,//文件是否自动上传
            "fileType":['png','jpg','docx','doc']//文件类型限制，默认不限制，注意写的是文件后缀
        });
        function beforeUploadFun(opt){
            opt.otherData =[{"name":"images","value":""}];
        }
        function onUploadFun(opt,data){
            alert(data);
            uploadTools.uploadError(opt);//显示上传错误
            uploadTools.uploadSuccess(opt);//显示上传成功
        }


        function testUpload(){
            var opt = uploadTools.getOpt("fileUploadContent");
            uploadEvent.uploadFileEvent(opt);
        }
    })
</script>

<script type="text/javascript">

    $(function () {
        /*ajax页面加载icheck，有该控件的页面才需要*/
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });

        /*ajax页面加载icheck，有该控件的页面才需要*/
        $(".select2").select2({language: "zh-CN"});

        $('.timepicker').datetimepicker({
            format: 'YYYY-MM-DD',   //YYYY-MM-DD HH:mm:ss
            locale: moment.locale('zh-cn')
        });


        {if condition = " $rest_login == 1 "}

        restlogin('{$rest_login_info}');   //登录超时
        {/if}


    })
</script>
<script>
    $(function(){

        $("#city").citySelect({
            url:"/assets/js/city.min.js",
            prov:"上海", //省份
            city:"黄浦区", //城市
            // dist:"黄浦区", //区县
            nodata:"none" //当子集无数据时，隐藏select
        });

    })
</script>
{/block}